﻿using QMERP.Domain.Entities;
using QMERP.Domain.Enums;

namespace QMERP.Infrastructure.EFCore.Extensions
{
    public static class AttachmentExtension
    {
        public static IQueryable<Attachment> GetByOwnerId(this IQueryable<Attachment> query, AttachmentOwnerTypeEnum ownerType, long ownerId)
        {
            return query.Where(x => x.OwnerType == ownerType.ToString() && x.OwnerId == ownerId);
        }
    }
}
